package com.sskj.bim;

/**
 * @Author: Like
 * @Date: 2025/3/18 10:32
 * @Description: 转换
 */

import java.io.IOException;

public class FBXToGLTFConverter {

    public static void main(String[] args) {
        String fbxFilePath = "C:\\Users\\Admin\\Downloads\\BZG_BIM_031333.FBX";
        String gltfFilePath = "C:\\Users\\Admin\\Downloads\\BZG_BIM_031334.glb";

        try {
            Process process = Runtime.getRuntime().exec("C:\\Users\\Admin\\Downloads\\FBX2glTF.exe -i " + fbxFilePath + " -o " + gltfFilePath + " -b");
            int exitCode = process.waitFor();
            if (exitCode == 0) {
                System.out.println("FBX file successfully converted to GLTF: " + gltfFilePath);
            } else {
                System.err.println("Failed to convert FBX to GLTF. Exit code: " + exitCode);
            }
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}
